package com.yxy.common.enums;

public enum UploadTaskStatus {

    waiting("waiting", "等待中"), uploading("uploading", "上传中"),
    finished("finished", "已完成"),partial_success("partial_success", "部分成功"),failed("failed", "已失败"),
    canceled("canceled", "已取消");

    private final String code;
    private final String info;

    UploadTaskStatus(String code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public String  getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }

    public static UploadTaskStatus getByCode(int code) {
        for (UploadTaskStatus value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

}
